]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: align AspectContainer to bottom if restricting vertically
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 5 Mar 2019 18:33:49 +0000 (19:33 +0100)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Tue, 5 Mar 2019 21:11:47 +0000 (21:11 +0000)
It is convenient for the OSK so it eg. doesn't appear centered in the
available space (eg. on very narrow portrait layouts), plus it will also
be convenient to align other AspectContainers to the same baseline.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439

js/ui/keyboard.js

index bfddcdec908659bce73fb15629808c6245cae00f..124831d6ae778db52bd2b78eaddd986e6cf92dda 100644 (file)
@@ -73,12 +73,9 @@ class AspectContainer extends St.Widget {
                 box.x1 += Math.floor(diff / 2);
                 box.x2 -= Math.ceil(diff / 2);
             } else {
-                /* Restrict vertically */
+                /* Restrict vertically, align to bottom */
                 let height = box.get_width() / this._ratio;
-                let diff = box.get_height() - height;
-
-                box.y1 += Math.floor(diff / 2);
-                box.y2 -= Math.floor(diff / 2);
+                box.y1 = box.y2 - Math.floor(height);
             }
         }